//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.huitu.whht.api.core.common.response;


public class StatusRespBuilder {
    private static final Integer STATUS_SUCCESS = 1;
    private static final Integer STATUS_FAIL = 0;
    private static final String ACTION_INSERT = "新增";
    private static final String ACTION_UPDATE = "更新";
    private static final String ACTION_DELETE = "删除";
    private static final String DESC_SUCCESS = "成功";
    private static final String DESC_FAIL = "失败";

    public StatusRespBuilder() {
    }

    public static StatusResp deleteSuccess() {
        return new StatusResp(STATUS_SUCCESS, "删除成功");
    }

    public static StatusResp deleteFail() {
        return new StatusResp(STATUS_FAIL, "删除失败");
    }

    public static StatusResp deleteFail(String message) {
        return new StatusResp(STATUS_FAIL, message);
    }

    public static StatusResp delete(Integer status) {
        return status > 0 ? insertSuccess() : insertFail();
    }

    public static StatusResp updateSuccess() {
        return new StatusResp(STATUS_SUCCESS, "更新成功");
    }

    public static StatusResp updateFail() {
        return new StatusResp(STATUS_FAIL, "更新失败");
    }

    public static StatusResp update(Integer status) {
        return status > 0 ? updateSuccess() : updateFail();
    }

    public static StatusResp insertSuccess() {
        return new StatusResp(STATUS_SUCCESS, "新增成功");
    }

    public static StatusResp insertSuccess(Object data) {
        return new StatusResp(STATUS_SUCCESS, "新增成功", data);
    }

    public static StatusResp insertFail() {
        return new StatusResp(STATUS_FAIL, "新增失败");
    }

    public static StatusResp insertFail(Object data) {
        return new StatusResp(STATUS_FAIL, "新增失败", data);
    }

    public static StatusResp insert(Integer status) {
        return status > 0 ? insertSuccess() : insertFail();
    }

    public static StatusResp insert(Integer status, Object data) {
        return status > 0 ? insertSuccess(data) : insertFail(data);
    }
}
